﻿using System;
using System.Collections.Generic;
using System.Text;

namespace ChangeProblem.Logic
{
    public class ChangeProblemLogic
    {
        public int[] GetChange(decimal change,decimal[] money) 
        {
            int[] changes = new int[money.Length];
            for(int i = 0; i < money.Length; i++)
            {
                changes[i] = (int)(change / money[i]);
                change = change - money[i] * changes[i];
            }
            
            return changes;
        }

        public decimal GetBalance(decimal price, decimal pay)
        {
            return pay - price;
        }
    }
}
